< previous page page_142 next page >

Page 142
   Dim src$, dest$
   Dim res&

   src$ = GetNullsString(FileList)
   dest$ = "A:\" & Chr$(0) & Chr$(0)

   sh.hwnd = hwnd
   sh.wFunc = FO_COPY
   sh.pFrom = src$
   sh.pTo = dest$
   sh.fFlags = FOF_RENAMEONCOLLISION Or FOF_WANTMAPPINGHANDLE
   sh.hNameMappings = 0

   res = DoTheShellCall(sh, "Files are being copied to floppy")

   If sh.hNameMappings <> 0 Then
         ' Can you read the file names here?
      Call SHFreeNameMappings(sh.hNameMappings)
   End If

End Sub
Removing the FOF_SIMPLEPROGRESS flag from the program allows you to see the individual file names as they are copied. The FOF_WANTMAPPINGHANDLE constant is added to enable the hNameMappings parameter. If the sh.hNameMappings is not 0, you need to free the Name Mapping object in order to prevent a memory leak.
Results
There are no results to see here yet. This is a bit more open-ended. Think you can handle it?
7017a6ead0e3c4111b47a554df321e9f.gif 7017a6ead0e3c4111b47a554df321e9f.gif
TECH REVIEWER'S COMMENT
Dan, this is totally unfair. You haven't bothered to explain what a mapping handle is or how to use it. I can't even figure out why I never see a non-zero value in the hNameMappings field. You have to give them better information than this.
7017a6ead0e3c4111b47a554df321e9f.gif 7017a6ead0e3c4111b47a554df321e9f.gif
AUTHOR RESPONSE
You're right that it's a nasty one. It took me two hours to figure out how to make this work, and most people reading this are never going to get it. But it's not unfair. Believe it or not, I've included every piece of relevant

 
< previous page page_142 next page >